package com.threeti.mecool.core.domain.model.plan.pojo;

public class UserGroupStep extends UserStep {
	@Override
	public boolean isFinished() {
		GroupStep groupStep = (GroupStep) getStep();
		UserJob userJob = getUserJob();
		for (GroupStepItem item : groupStep.getItems()) {
			UserStep userStep = userJob.findUserStepByStep(item.getNextStep());
			if (!userStep.isFinished() && !userStep.getStep().isOptional()) {
				return false;
			}
		}
		return true;
	}
}
